#include "app_pool.h"
#include "log/log.h"

int task_fun(void *arg) {
    log_debug("线程(%d)执行，参数：%s", gettid(), (char *)arg);
}


int main(int argc, char const *argv[])
{
    app_pool_init(5);

    for (int i = 0; i < 10; i++)
    {
       char *msg = malloc(10);
        sprintf(msg, "hello_%d", i);

        app_pool_addTask(task_fun, msg);
    }
    //等待子线程的任务结束
    sleep(1);
    //销毁线程池
    app_pool_destroy();
    return 0;
}
